<template>
  <!-- 黑号查询 -->
  <div class="app-container" v-loading="loading">
    <el-form :model="queryParams" ref="queryForm" class="search-form-new" :inline="true" label-width="68px">
     
      <el-form-item label="账号" prop="content">
        <el-input
          v-model="queryParams.content"
          placeholder="请输入要查询的账号"
          clearable
        />
      </el-form-item>

      <el-form-item class="btns">
        <el-button type="primary" icon="el-icon-search" @click="handleQuery">查询</el-button>
        <el-button type="success" icon="el-icon-plus" @click="openadd">新增黑名单</el-button>
        <el-button type="warning"  @click="openMy">我的黑名单</el-button>
        <!-- <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> -->
      </el-form-item>
    </el-form>
    <div class="table-box bgf radius">
      <el-table stripe  :data="blackList" >
        <el-table-column label="帐号" align="center" prop="account" />
        <!-- <el-table-column label="游戏编码" align="center" prop="game_sn" /> -->
        <el-table-column label="游戏名称" align="center" prop="game_name" />
        <!-- <el-table-column label="手机号" align="center" prop="mobile" />
        <el-table-column label="微信" align="center" prop="wx" />
        <el-table-column label="身份证号" align="center" prop="idNo" />
        <el-table-column label="姓名" align="center" prop="name" />
        <el-table-column label="支付宝" align="center" prop="payment_account" /> -->
        <el-table-column label="录入时间" align="center" prop="add_time" >
          <template slot-scope="scope">
            <span>{{ scope.row.create_time || scope.row.add_time}}</span>
          </template>
        </el-table-column>
        <el-table-column label="平台" align="center" prop="channel_name" />
        <el-table-column label="备注" align="center" prop="remark" />
        <!-- <el-table-column label="省" align="center" prop="province_name" />
        <el-table-column label="市" align="center" prop="city_name" />
        <el-table-column label="区" align="center" prop="area_name" />
        <el-table-column label="结果" align="center" prop="status" /> -->
      </el-table>

      <!-- <pagination
        v-show="total>0"
        :total="total"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        @pagination="getList"
      /> -->
    </div>
    <addDialog ref="addDialog"></addDialog>
    <myHeihao ref="myHeihao"></myHeihao>
    
  </div>
</template>

<script>
import { listBlack,gameType } from "@/api/black/black";
import addDialog from './add.vue'
import myHeihao from "./myHeihao.vue"
export default {
  name: "Black",
  components:{addDialog,myHeihao},
  data() {
    return {
      // 遮罩层
      loading: false,
      // 导出遮罩层
      exportLoading: false,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 黑名单列表表格数据
      blackList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      gameList: [],
      quality: {
        type: [String, Number],
        required: false,
        default: 0.618,
      },
      widths: {
        type: [String, Number],
        required: false,
        default: 1366,
      },
      returnType: {
        type: String,
        required: false,
        default: "base64",
        validator: (value) => {
          return ["base64", "file"].indexOf(value) !== -1;
        },
      },
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        createId: null,
        updateId: null,
        accountId: null,
        account: null,
        game_sn: null,
        content: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    // this.gameType()
  },
  methods: {
    openMy(){
      this.$refs.myHeihao.open()
    },
    openadd(){
      this.$refs.addDialog.open()
    },
    // gameType(){
    //   gameType().then(res =>{
    //     if (res.code == 200){
    //       this.gameList = res.data
    //     }
    //   })
    // },
    /** 查询黑名单列表列表 */
    getList() {
       const loginLoading = this.$loading({
                lock: true,
                text: '检测中...',
                spinner: 'el-icon-loading',
                background: 'rgba(0, 0, 0, 0.7)',
                customClass: 'highlight-loadings',
            });

      listBlack(this.queryParams).then(response => {
        this.blackList = response.rows;
        this.total = response.total;
       
        if(response.code==200&&response.params&&response.params.cot>0){
          this.$alert(`账号存在异常，当前${response.params.cot}家同行正在销售`, '提示', {
          confirmButtonText: '确定',
          callback: action => {
           
          }
        });
        }
      }).catch(err=>{
        
      }).finally(() => {
                loginLoading.close();
            });
    },
    /** 搜索按钮操作 */
    handleQuery() {
      // if ('' == this.queryParams.game_sn || null == this.queryParams.game_sn){
      //   this.$message.error('请选择游戏!');
      //   return true;
      // }
      if ('' == this.queryParams.content || null == this.queryParams.content){
        this.$message.error('请输入账号!');
        return true;
      }
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
  }
};
</script>
<style lang="scss" >

.highlight-loadings {
    /* 1. 提高层级，覆盖其他内容 */
    z-index: 9999 !important;

    /* 2. 加载动画放大 + 颜色突出 */
    .el-loading-spinner {
        top: 45% !important;
        /* 居中偏上，更醒目 */
        transform: translateY(-50%) scale(1.5);
        /* 放大 1.5 倍 */

        .el-icon-loading {
            font-size: 48px !important;
            /* 图标放大 */
            color: #409eff !important;
            /* 亮蓝色，对比深色背景 */
            animation: rotate 1.5s linear infinite;
            /* 加快旋转速度 */
        }

        /* 3. 文字强化 */
        .el-loading-text {
            margin-top: 20px !important;
            font-size: 18px !important;
            color: #fff !important;
            /* 白色文字，与深色背景对比 */
            font-weight: bold;
            text-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
            /* 文字阴影，增强可读性 */
        }
    }

    /* 4. 可选：添加背景动效（呼吸渐变） */
    &::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: radial-gradient(circle at center, rgba(64, 158, 255, 0.2) 0%, transparent 70%);
        animation: pulse 3s infinite;
    }

}

/* 自定义动画：加快旋转 */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* 自定义动画：呼吸效果 */
@keyframes pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 0.3;
    }
}
</style>
